Optional Parameters

Hi is it possible to pass as optional a parameter to a method? How i need to define the method?


bungle77 - Wed Jul 03 10:10:43 EDT 2013

Re: Optional Parameters
adevicq - Thu Jul 04 03:34:10 EDT 2013

Hi,

You must define several prototypes to do so. For example:

void f(int a, int b) {
...
}


// defines f with a default value for the second parameter

void f(int a) {
    f(a, 0)
}

 

regards,

alain